import 'package:get/get.dart';
import 'package:lx_widgets_library/custom_controller/scroll_opacity_controller.dart';

import 'state.dart';

class PdfPreviewArguments {
  String navTitle = "";
  String pdfUrl = "";
  String pdfFilePath = "";

  String get path => pdfFilePath.isEmpty ? pdfUrl : pdfFilePath;
}

class PdfPreviewController extends LxBaseScrollOpacityController {
  // 状态
  PdfPreviewState state = PdfPreviewState();

  @override
  onInit() async {
    super.onInit();
    // 页面数据
    if (Get.arguments != null) {
      // 接受页面数据
      state.pdfPreviewArguments.value = Get.arguments as PdfPreviewArguments;
    }
  }
}
